<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* display:none      将元素隐藏 元素将彻底放弃位置 */
        /* visibility:hidden 将元素隐藏 元素不会放弃位置 */
        .box1 {
            width: 200px;
            height: 200px;
            background-color: red;
            /* 隐藏但是位置还在 */
            visibility: hidden;
        }

        .box2 {
            width: 200px;
            height: 200px;
            background-color: yellow;
            /* 隐藏且彻底放弃了位置 */
            display: none;
        }

        .box3 {
            width: 200px;
            height: 200px;
            background-color: blue;
        }
    </style>
</head>

<body>
    <div class="box1"></div>
    <div class="box2"></div>
    <div class="box3"></div>
</body>

</html>